package com.fyl.spring.controller;

import com.fyl.spring.service.UserService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

public class UserController {
    public static void main(String[] args) {
//        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        BeanFactory context = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
        UserService userService = context.getBean("userService", UserService.class);

        userService.add();
    }
}
